/*
* Bind a fresh port to VIRQ @virq.
- * Return allocated port.
*/
#define IOCTL_EVTCHN_BIND_VIRQ \
_IOWR('E', 4, struct ioctl_evtchn_bind_virq)
/*
* Bind a fresh port to remote <@remote_domain, @remote_port>.
- * Return allocated port.
*/
#define IOCTL_EVTCHN_BIND_INTERDOMAIN \
_IOWR('E', 5, struct ioctl_evtchn_bind_interdomain)
/*
* Allocate a fresh port for binding to @remote_domain.
- * Return allocated port.
*/
#define IOCTL_EVTCHN_BIND_UNBOUND_PORT \
_IOWR('E', 6, struct ioctl_evtchn_bind_unbound_port)
return ioctl(xce_handle, IOCTL_EVTCHN_NOTIFY, ¬ify);
}
+evtchn_port_or_error_t
+xc_evtchn_bind_unbound_port(int xce_handle, int domid)
+{
+ struct ioctl_evtchn_bind_unbound_port bind;
+ int ret;
+
+ bind.remote_domain = domid;
+
+ ret = ioctl(xce_handle, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
+ if (ret == 0)
+ return bind.port;
+ else
+ return -1;
+}
+
evtchn_port_or_error_t
xc_evtchn_bind_interdomain(int xce_handle, int domid,
evtchn_port_t remote_port)